package com.baizhi.service.impl;

import com.baizhi.cache.AddCacheAnnotation;
import com.baizhi.entity.BzMenu;
import com.baizhi.dao.BzMenuMapper;
import com.baizhi.log.LogAnnotation;
import com.baizhi.log.LogType;
import com.baizhi.service.IBzMenuService;
import com.baizhi.vo.ZtreeNodeVo;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 菜单管理; InnoDB free: 13312 kB 服务实现类
 * </p>
 *
 * @author lby
 * @since 2020-12-18
 */
@Slf4j
@Service
public class BzMenuServiceImpl extends ServiceImpl<BzMenuMapper, BzMenu> implements IBzMenuService {


    @Autowired
    private BzMenuMapper menuMapper;

    @AddCacheAnnotation
    @Override
    public List<BzMenu> selectMenuListBySql() {
        List<BzMenu> bzMenus = menuMapper.selectMenuListBySql();
        return bzMenus;
    }

    @LogAnnotation(type= LogType.SELECT,content="查询菜单ztree数据")
    @Override
    public List<ZtreeNodeVo> selectZtreeNodesBySql() {
        return menuMapper.selectZtreeNodesBySql();
    }
}
